import { MockMethod } from "vite-plugin-mock"

export default [
  {
    url: "/dev-api/home/statistics",
    timeout: 2000,
    method: "get",
    response: () => {
      return {
        "code": 20000,
        "message": "查询成功",
        "data": {
          "totalOrderNum": "@integer(5, 1000)", // 5-1000间的数字
          "totalSaleMoney": "@float(3000, 50000, 1, 2)", // 000-50000小数(1-2位小数）
          "totalReturnedMoney": "@float(0, 1000, 1, 2)",
          "totalIncomeMoney": "@float(30000, 500000, 1, 2)"
        }
      }
    },
  },
  {
    url: "/dev-api/home/categoryData",
    timeout: 2000,
    method: "get",
    response: () => {
      return {
        "code": 20000,
        "message": "查询成功",
        "data|5": [{
          "name": '@first', // 英文名
          "value": "@integer(8000, 50000)", // 8000-50000间的数字
        }]
      }
    },
  },
  {
    url: "/dev-api/home/30days/saleData",
    timeout: 2000,
    method: "get",
    response: () => {
      return {
        "code": 20000,
        "message": "查询成功",
        "data": {
          "last30Days": [
            "06-28", "06-29", "06-30", "07-01", "07-02",
            "07-03", "07-04", "07-05", "07-06", "07-07",
            "07-08", "07-09", "07-10", "07-11", "07-12",
            "07-13", "07-14", "07-15", "07-16", "07-17",
            "07-18", "07-19", "07-20", "07-21", "07-22",
            "07-23", "07-24", "07-25", "07-26", "07-27"
          ],
          "orderNumList|30": ["@integer(100, 500)"],
          "saleMoneyList|30": ["@integer(1000, 5000)"],
          "returnMoneyList|30": ["@integer(0, 1000)"],
          "rechargeMoneyList|30": ["@integer(200, 2000)"]
        }
      }
    },
  },
  {
    url: "/dev-api/home/member/top10",
    timeout: 2000,
    method: "get",
    response: () => {
      return {
        "code": 20000,
        "message": "查询成功",
        "data|10": [{
          "name": "@cname", // 5-1000间的数字
          "consumeMoney|+10000": 2000
        }]
      }
    },
  },
] as MockMethod[]

